package com.esheeper.mainserver.controller;

import com.esheeper.mainserver.pojo.UserDetail;
import com.esheeper.mainserver.service.UserService;
import com.esheeper.mainserver.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class UserDetailController {

   @Autowired
   ResponseUtil res;
   @Autowired
    UserService userService;

    @GetMapping("/user/self")
    Map getSelfInfo(@CookieValue("id") String id){
        return res.success(userService.queryUserDetailById(id));
    }

    @GetMapping("/post/{type}/{operation}/{id}")
    Map getPost(@PathVariable("type") String type,
                @PathVariable("operation") String operation,
                @PathVariable("id") String id){
        switch (operation){
            case "new":

                break;
            case "refresh":

                break;
            case "next":
                break;
            default:
                return res.fail(ResponseUtil.REQUEST_ERROR_PARAMS_ERROR,null);
        }
    }


}
